add_executable(TestEncoding testEncoding.cpp)

target_link_libraries(
    TestEncoding
    PRIVATE ${PROJECT_NAME}
)

add_test(
    NAME TestEncoding
    COMMAND TestEncoding
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)

if (sdlengine-component-bresenham)
    add_executable(TestBresenham testBresenham.cpp)

    target_link_libraries(
        TestBresenham
        PRIVATE ${PROJECT_NAME} Component::Bresenham
    )

    add_test(
        NAME TestBresenham
        COMMAND TestBresenham --log-level=trace
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
    )
endif()

if (sdlengine-component-luascript)
    add_executable(TestLuaScript testLuaScript.cpp)

    target_link_libraries(
        TestLuaScript
        PRIVATE ${PROJECT_NAME} Component::LuaScript
    )

    add_test(
        NAME TestLuaScript
        COMMAND TestLuaScript
        WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
    )
endif()

add_executable(TestObjectPool testObjectPool.cpp)

target_link_libraries(
    TestObjectPool
    PRIVATE ${PROJECT_NAME} Component::ObjectPool
)

add_test(
    NAME TestObjectPool
    COMMAND TestObjectPool
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)



add_executable(TestInnerBmpFont testInnerBmpFont.cpp)

target_link_libraries(
    TestInnerBmpFont
    PRIVATE ${PROJECT_NAME}
)

add_test(
    NAME TestInnerBmpFont
    COMMAND TestInnerBmpFont
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)


add_executable(TestTileSheet testTileSheet.cpp)

target_link_libraries(
    TestTileSheet
    PRIVATE ${PROJECT_NAME}
)

add_test(
    NAME TestTileSheet
    COMMAND TestTileSheet
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)


add_executable(TestCmdLineParser testCmdLineParser.cpp)

target_link_libraries(
    TestCmdLineParser
    PRIVATE ${PROJECT_NAME}
)

add_test(
    NAME TestCmdLineParser
    COMMAND TestCmdLineParser --name=visualgmq -h --age=123
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)


add_executable(TestGUI testGui.cpp)

target_link_libraries(
    TestGUI
    PRIVATE ${PROJECT_NAME}
)

add_test(
    NAME TestGUI
    COMMAND TestGUI
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)


add_executable(TestAudio testAudio.cpp)

target_link_libraries(
    TestAudio
    PRIVATE ${PROJECT_NAME}
)

add_test(
    NAME TestAudio
    COMMAND TestAudio
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)


add_executable(TestMath testMath.cpp)

target_link_libraries(
    TestMath
    PRIVATE ${PROJECT_NAME}
)

add_test(
    NAME TestMath
    COMMAND TestMath
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)


add_executable(TestTool testTool.cpp)

target_link_libraries(
    TestTool
    PRIVATE ${PROJECT_NAME}
)

add_test(
    NAME TestTool
    COMMAND TestTool
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)


add_executable(TestSDLAudio testSDLAudio.cpp)

target_link_libraries(
    TestSDLAudio
    PRIVATE SDL2_DEP
)

add_test(
    NAME TestSDLAudio
    COMMAND TestTool
    WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/tests
)
